﻿using System;
using UnityEngine;

namespace SteeringBehaviors
{
	// Token: 0x02000216 RID: 534
	public class SteerBehavior
	{
		// Token: 0x06000B3F RID: 2879 RVA: 0x0005E97F File Offset: 0x0005CB7F
		public SteerBehavior(MovementCharacter agent, IKinematic target)
		{
			this.agent = agent;
			this.target = target;
			this.pSteering = new SteeringOutput();
		}

		// Token: 0x06000B40 RID: 2880 RVA: 0x0005E9AB File Offset: 0x0005CBAB
		public virtual SteeringOutput GetSteering()
		{
			return this.pSteering;
		}

		// Token: 0x06000B41 RID: 2881 RVA: 0x0005E9B3 File Offset: 0x0005CBB3
		public float MapToRange(float rotation)
		{
			rotation %= 360f;
			if (rotation > 180f)
			{
				rotation -= 360f;
			}
			else if (rotation < -180f)
			{
				rotation += 360f;
			}
			return rotation;
		}

		// Token: 0x06000B42 RID: 2882 RVA: 0x0005E9EC File Offset: 0x0005CBEC
		public Vector3 OrientationToVector(float orientation)
		{
			return new Vector3
			{
				x = Mathf.Sin(orientation * 0.017453292f),
				z = Mathf.Cos(orientation * 0.017453292f)
			};
		}

		// Token: 0x06000B43 RID: 2883 RVA: 0x0005EA28 File Offset: 0x0005CC28
		public float RandomBinomial()
		{
			return UnityEngine.Random.Range(0f, 1f) - UnityEngine.Random.Range(0f, 1f);
		}

		// Token: 0x04001051 RID: 4177
		public IKinematic target;

		// Token: 0x04001052 RID: 4178
		public MovementCharacter agent;

		// Token: 0x04001053 RID: 4179
		public float Weight = 1f;

		// Token: 0x04001054 RID: 4180
		protected SteeringOutput pSteering;
	}
}
